<html>
<head><meta charset="utf-8"><title>issue-51345-dead-code-activation · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html">issue-51345-dead-code-activation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="129100068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129100068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129100068">(Jul 04 2018 at 19:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Submitted <a href="https://github.com/rust-lang/rust/pull/52058" target="_blank" title="https://github.com/rust-lang/rust/pull/52058">a PR</a> for this issue. I've not ran all the tests locally but it fixes the repro in the issue.</p>



<a name="129100289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129100289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129100289">(Jul 04 2018 at 19:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> see <a href="https://github.com/rust-lang/rust/pull/52058#pullrequestreview-134458233" target="_blank" title="https://github.com/rust-lang/rust/pull/52058#pullrequestreview-134458233">my review here</a></p>



<a name="129103688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129103688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129103688">(Jul 04 2018 at 20:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Pushed a fix. Didn't take long to do but then spent ages getting confused why the <code>run-pass</code> test was failing even though it was now compiling correctly, then I noticed that the example had <code>panic!()</code>...</p>



<a name="129103708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129103708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129103708">(Jul 04 2018 at 20:38)</a>:</h4>
<p>heh sorry :)</p>



<a name="129103832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129103832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129103832">(Jul 04 2018 at 20:40)</a>:</h4>
<p><span class="user-mention" data-user-id="116107">@David Wood</span> left a few comment nits :)</p>



<a name="129103909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129103909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129103909">(Jul 04 2018 at 20:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm not sure I follow your first nit.</p>



<a name="129103939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129103939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129103939">(Jul 04 2018 at 20:43)</a>:</h4>
<blockquote>
<p>Then when we do find an activation we can assert that the field is "not activated".</p>
</blockquote>
<p>I took this (from first review) to mean that where we change to <code>ActivatedAt</code>, we should assert that we were at <code>NotActivated</code> (as opposed to <code>NotTwoPhase</code>)?</p>



<a name="129103992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129103992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129103992">(Jul 04 2018 at 20:44)</a>:</h4>
<p>that is correct</p>



<a name="129104000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104000">(Jul 04 2018 at 20:44)</a>:</h4>
<p>I'm just saying that the purpose of that check</p>



<a name="129104007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104007">(Jul 04 2018 at 20:44)</a>:</h4>
<p>Are you referring to the comment?</p>



<a name="129104008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104008">(Jul 04 2018 at 20:44)</a>:</h4>
<p>is to make sure that we are "activating" something that we considered 2-phase in the first place</p>



<a name="129104017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104017">(Jul 04 2018 at 20:44)</a>:</h4>
<p>but your comment made it sound like this was checking that we found an activation for each thing</p>



<a name="129104021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104021">(Jul 04 2018 at 20:44)</a>:</h4>
<p>Ah.</p>



<a name="129104022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104022">(Jul 04 2018 at 20:45)</a>:</h4>
<p>yes, the comment</p>



<a name="129104031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104031">(Jul 04 2018 at 20:45)</a>:</h4>
<p>I see, I thought you meant the <code>assert!</code> itself, the location or contents of it.</p>



<a name="129104032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104032">(Jul 04 2018 at 20:45)</a>:</h4>
<p>to check that latter thing we'd have to do some kind of iteration at the end</p>



<a name="129104037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104037">(Jul 04 2018 at 20:45)</a>:</h4>
<p>ah, no. the code is fine.</p>



<a name="129104044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104044">(Jul 04 2018 at 20:45)</a>:</h4>
<p>"I think this commit" = "this comment"</p>



<a name="129104046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104046">(Jul 04 2018 at 20:45)</a>:</h4>
<p>I copied the comment from the previous assert that was removed, I'll update it to something more appropriate.</p>



<a name="129104166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104166">(Jul 04 2018 at 20:48)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Pushed up the improved comments.</p>



<a name="129104184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation/near/129104184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/issue-51345-dead-code-activation.html#129104184">(Jul 04 2018 at 20:49)</a>:</h4>
<p>r+, nice</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>